import './App.css'
import { HashRouter as Router, Switch, Redirect, Route } from 'react-router-dom'

// 导入页面
import Login from './views/login'
import Layout from './views/layout'

// 导入子组件
import AuthRoute from '@/components/AuthRoute'

function App () {
  return (
    <div className='App'>
      <Router>
        <Switch>
          <Route path='/login' component={Login} />
          {/* <Route path='/layout' component={Layout} /> */}
          <AuthRoute
            path='/layout'
            component={Layout}
            meta={{ title: '黑马面面' }}
          />
          <Redirect exact from='/' to='/login' />
        </Switch>
      </Router>
    </div>
  )
}

export default App
